/*************************************************************************
	> File Name: P2834.cpp
	> Author: yufangze
	> Mail: 2224590123@qq.com
	> Created Time: 2025-01-13 18:02:00
 ************************************************************************/

#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

#define MAX_M 10000

long long dp[MAX_M + 5];
int mod = 1e9 + 7;

int main() {
    int n, w;
    cin >> n >> w;
    dp[0] = 1;
    for (int i = 1, a; i <= n; i++) {
        cin >> a;
        for (int j = a; j <= w; j++) {
            dp[j] += dp[j - a];
            dp[j] %= mod;
        }
    }
    cout << dp[w] << endl;
    return 0;
}
